//
//  OPBaseController.m
//  OnePiece
//
//  Created by wsy on 15/10/26.
//  Copyright © 2015年 wsy. All rights reserved.
//

#import "OPBaseController.h"

@interface OPBaseController ()

@end

@implementation OPBaseController
- (UIView *)topView
{
    if (!_topView) {
        _topView =[[UIView alloc]initWithFrame:CGRectMake(0, 20, SCREEN_WIDTH, 44)];
        _topView.backgroundColor = [UIColor whiteColor];
        _leftButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _titleLable = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH/2-120, 10, 240, 24)];
        _titleLable.textColor = [UIColor blackColor];
        _titleLable.textAlignment = NSTextAlignmentCenter;
        [_topView addSubview:_titleLable];
        _leftButton.frame = CGRectMake(15, 15, 20, 20);
        [_leftButton setBackgroundImage:[UIImage imageNamed:@""] forState:(UIControlStateNormal)];
        [_leftButton setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
        [_topView addSubview:_leftButton];
        [self.view addSubview:_topView];
    }
    return _topView;
}





- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    NSLog(@"%@",self.topView);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}






/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
